<?php

namespace app\controller;

use app\common\MyFacadeTest;
use app\common\MyRedis;
use app\manager\RedisDriver;
use app\manager\RedisInstance;
use think\facade\Db;
use think\facade\View;

class Test extends Base
{


    public function test1(){

//     $b = null;
//     $a = isset($b) ? $b : "aa";
//     $a = $b ?? "aa";
//
//     $b=33;
//     $a = empty($b) ? $b : "aa";
//     $a = $b ?: "aa";
//     setcookie("name", "flj");
     return "极大送";
 }

    public function redisTest1(){
        //测试1
//        $host = config('app.host');
//        $port = config("app.port");
//        $pwd = config('app.pwd');
//        //echo $port;exit();
//        $redis = new RedisDriver($host,$port,$pwd);
//
//        $redis->get("name");
        //测试2
//        $host = config("host2");
//        $redis = new RedisDriver($host,$port,$pwd);
//        $redis->get("name");
        $key = '6981';
        $val = 'ge';
        RedisInstance::set($key,$val);


    }

    public function redisTest2(){
        $se = $_SESSION['uid'];
        out($se);
        //测试3
//        View::assign();
        $key = '6981';
        $fe =  RedisInstance::get($key);
        echo $fe.'和';exit();
    }


    public function testFacade(){
       // out(MyFacadeTest::hello('来了'));
        out(MyFacadeTest::hello('熬123'));
    }

}